home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / plugin / npapi.h next >
C/C++ Source or Header  |  2006-05-08  |  21KB  |  727 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38.  
  39. /*
  40.  *  npapi.h $Revision: 3.40.4.1 $
  41.  *  Netscape client plug-in API spec
  42.  */
  43.  
  44. #ifndef _NPAPI_H_
  45. #define _NPAPI_H_
  46.  
  47. #ifdef __OS2__
  48. #pragma pack(1)
  49. #endif
  50.  
  51. #include "prtypes.h"
  52. /* Copied from xp_core.h */
  53. /* removed #ifdef for hpux defined in /usr/include/model.h */
  54. #ifndef XP_MAC
  55. #ifndef _INT16
  56. #define _INT16
  57. #endif
  58. #ifndef _INT32
  59. #define _INT32
  60. #endif
  61. #ifndef _UINT16
  62. #define _UINT16
  63. #endif
  64. #ifndef _UINT32
  65. #define _UINT32
  66. #endif
  67. #endif
  68.  
  69. /* 
  70.  * NO_NSPR_10_SUPPORT disables the inclusion 
  71.  * of obsolete/protypes.h, whose int16, uint16, 
  72.  * int32, and uint32 typedefs conflict with those 
  73.  * in this file. 
  74.  */ 
  75. #ifndef NO_NSPR_10_SUPPORT
  76. #define NO_NSPR_10_SUPPORT
  77. #endif
  78. #ifdef OJI
  79. #include "jri.h"                /* Java Runtime Interface */
  80. #endif
  81.  
  82. #if defined (__OS2__ ) || defined (OS2)
  83. #    ifndef XP_OS2
  84. #        define XP_OS2 1
  85. #    endif /* XP_OS2 */
  86. #endif /* __OS2__ */
  87.  
  88. #ifdef _WINDOWS
  89. #    include <windef.h>
  90. #    ifndef XP_WIN
  91. #        define XP_WIN 1
  92. #    endif /* XP_WIN */
  93. #endif /* _WINDOWS */
  94.  
  95. #ifdef __MWERKS__
  96. #    define _declspec __declspec
  97. #    ifdef macintosh
  98. #        ifndef XP_MAC
  99. #            define XP_MAC 1
  100. #        endif /* XP_MAC */
  101. #    endif /* macintosh */
  102. #    ifdef __INTEL__
  103. #        undef NULL
  104. #        ifndef XP_WIN
  105. #            define XP_WIN 1
  106. #        endif /* XP_WIN */
  107. #    endif /* __INTEL__ */
  108. #endif /* __MWERKS__ */
  109.  
  110. #if defined(XP_MAC) || defined(XP_MACOSX)
  111.     #include <Quickdraw.h>
  112.     #include <Events.h>
  113. #endif
  114.  
  115. #if defined(XP_UNIX) 
  116. #    include <stdio.h>
  117. #    if defined(MOZ_X11)
  118. #        include <X11/Xlib.h>
  119. #        include <X11/Xutil.h>
  120. #    endif
  121. #endif
  122.  
  123. /*----------------------------------------------------------------------*/
  124. /*                        Plugin Version Constants                      */
  125. /*----------------------------------------------------------------------*/
  126.  
  127. #define NP_VERSION_MAJOR 0
  128. #define NP_VERSION_MINOR 16
  129.  
  130.  
  131. /* The OS/2 version of Netscape uses RC_DATA to define the
  132.    mime types, file extensions, etc that are required.
  133.    Use a vertical bar to separate types, end types with \0.
  134.    FileVersion and ProductVersion are 32bit ints, all other
  135.    entries are strings the MUST be terminated wwith a \0.
  136.  
  137. AN EXAMPLE:
  138.  
  139. RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
  140.  
  141. RCDATA NP_INFO_MIMEType    { "video/x-video|",
  142.                              "video/x-flick\0" }
  143. RCDATA NP_INFO_FileExtents { "avi|",
  144.                              "flc\0" }
  145. RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
  146.                              "MMOS2 Flc/Fli player(*.flc)\0" }
  147.  
  148. RCDATA NP_INFO_FileVersion       { 1,0,0,1 }
  149. RCDATA NP_INFO_CompanyName       { "Netscape Communications\0" }
  150. RCDATA NP_INFO_FileDescription   { "NPAVI32 Extension DLL\0"
  151. RCDATA NP_INFO_InternalName      { "NPAVI32\0" )
  152. RCDATA NP_INFO_LegalCopyright    { "Copyright Netscape Communications \251 1996\0"
  153. RCDATA NP_INFO_OriginalFilename  { "NVAPI32.DLL" }
  154. RCDATA NP_INFO_ProductName       { "NPAVI32 Dynamic Link Library\0" }
  155.  
  156. */
  157.  
  158.  
  159. /* RC_DATA types for version info - required */
  160. #define NP_INFO_ProductVersion      1
  161. #define NP_INFO_MIMEType            2
  162. #define NP_INFO_FileOpenName        3
  163. #define NP_INFO_FileExtents         4
  164.  
  165. /* RC_DATA types for version info - used if found */
  166. #define NP_INFO_FileDescription     5
  167. #define NP_INFO_ProductName         6
  168.  
  169. /* RC_DATA types for version info - optional */
  170. #define NP_INFO_CompanyName         7
  171. #define NP_INFO_FileVersion         8
  172. #define NP_INFO_InternalName        9
  173. #define NP_INFO_LegalCopyright      10
  174. #define NP_INFO_OriginalFilename    11
  175.  
  176. #ifndef RC_INVOKED
  177.  
  178.  
  179.  
  180. /*----------------------------------------------------------------------*/
  181. /*                       Definition of Basic Types                      */
  182. /*----------------------------------------------------------------------*/
  183.  
  184. #ifndef _UINT16
  185. typedef unsigned short uint16;
  186. #endif
  187.  
  188. #ifndef _UINT32
  189. #    if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
  190. typedef unsigned int uint32;
  191. #    else  /* __alpha */
  192. typedef unsigned long uint32;
  193. #    endif /* __alpha */
  194. #endif
  195.  
  196. /*
  197.  * AIX defines these in sys/inttypes.h included from sys/types.h
  198.  */
  199. #ifndef AIX
  200. #ifndef _INT16
  201. typedef short int16;
  202. #endif
  203.  
  204. #ifndef _INT32
  205. #    if defined(__alpha) || defined(__amd64__) || defined(__x86_64__)
  206. typedef int int32;
  207. #    else  /* __alpha */
  208. typedef long int32;
  209. #    endif /* __alpha */
  210. #endif
  211. #endif
  212.  
  213. #ifndef FALSE
  214. #define FALSE (0)
  215. #endif
  216. #ifndef TRUE
  217. #define TRUE (1)
  218. #endif
  219. #ifndef NULL
  220. #define NULL (0L)
  221. #endif
  222.  
  223. typedef unsigned char    NPBool;
  224. typedef int16            NPError;
  225. typedef int16            NPReason;
  226. typedef char*            NPMIMEType;
  227.  
  228.  
  229.  
  230. /*----------------------------------------------------------------------*/
  231. /*                       Structures and definitions                     */
  232. /*----------------------------------------------------------------------*/
  233.  
  234. #ifdef XP_MAC
  235. #pragma options align=mac68k
  236. #endif
  237.  
  238. /*
  239.  *  NPP is a plug-in's opaque instance handle
  240.  */
  241. typedef struct _NPP
  242. {
  243.   void*    pdata;      /* plug-in private data */
  244.   void*    ndata;      /* netscape private data */
  245. } NPP_t;
  246.  
  247. typedef NPP_t*  NPP;
  248.  
  249.  
  250. typedef struct _NPStream
  251. {
  252.   void*  pdata; /* plug-in private data */
  253.   void*  ndata; /* netscape private data */
  254.   const  char* url;
  255.   uint32 end;
  256.   uint32 lastmodified;
  257.   void*  notifyData;
  258. } NPStream;
  259.  
  260.  
  261. typedef struct _NPByteRange
  262. {
  263.   int32  offset; /* negative offset means from the end */
  264.   uint32 length;
  265.   struct _NPByteRange* next;
  266. } NPByteRange;
  267.  
  268.  
  269. typedef struct _NPSavedData
  270. {
  271.   int32    len;
  272.   void*    buf;
  273. } NPSavedData;
  274.  
  275.  
  276. typedef struct _NPRect
  277. {
  278.   uint16 top;
  279.   uint16 left;
  280.   uint16 bottom;
  281.   uint16 right;
  282. } NPRect;
  283.  
  284. typedef struct _NPSize 
  285.   int32 width; 
  286.   int32 height; 
  287. } NPSize; 
  288.  
  289. #ifdef XP_UNIX
  290. /*
  291.  * Unix specific structures and definitions
  292.  */
  293.  
  294. /*
  295.  * Callback Structures.
  296.  *
  297.  * These are used to pass additional platform specific information.
  298.  */
  299. enum {
  300.   NP_SETWINDOW = 1,
  301.   NP_PRINT
  302. };
  303.  
  304. typedef struct
  305. {
  306.   int32 type;
  307. } NPAnyCallbackStruct;
  308.  
  309. typedef struct
  310. {
  311.   int32        type;
  312. #ifdef MOZ_X11
  313.   Display*     display;
  314.   Visual*      visual;
  315.   Colormap     colormap;
  316.   unsigned int depth;
  317. #endif
  318. } NPSetWindowCallbackStruct;
  319.  
  320. typedef struct
  321. {
  322.   int32 type;
  323.   FILE* fp;
  324. } NPPrintCallbackStruct;
  325.  
  326. #endif /* XP_UNIX */
  327.  
  328.  
  329. /*
  330.  *   The following masks are applied on certain platforms to NPNV and 
  331.  *   NPPV selectors that pass around pointers to COM interfaces. Newer 
  332.  *   compilers on some platforms may generate vtables that are not 
  333.  *   compatible with older compilers. To prevent older plugins from 
  334.  *   not understanding a new browser's ABI, these masks change the 
  335.  *   values of those selectors on those platforms. To remain backwards
  336.  *   compatible with differenet versions of the browser, plugins can 
  337.  *   use these masks to dynamically determine and use the correct C++
  338.  *   ABI that the browser is expecting. This does not apply to Windows 
  339.  *   as Microsoft's COM ABI will likely not change.
  340.  */
  341.  
  342. #define NP_ABI_GCC3_MASK  0x10000000
  343. /*
  344.  *   gcc 3.x generated vtables on UNIX and OSX are incompatible with 
  345.  *   previous compilers.
  346.  */
  347. #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
  348. #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
  349. #else
  350. #define _NP_ABI_MIXIN_FOR_GCC3 0
  351. #endif
  352.  
  353.  
  354. #define NP_ABI_MACHO_MASK 0x01000000
  355. /*
  356.  *   On OSX, the Mach-O executable format is significantly
  357.  *   different than CFM. In addition to having a different
  358.  *   C++ ABI, it also has has different C calling convention.
  359.  *   You must use glue code when calling between CFM and
  360.  *   Mach-O C functions. 
  361.  */
  362. #if (defined(TARGET_RT_MAC_MACHO))
  363. #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
  364. #else
  365. #define _NP_ABI_MIXIN_FOR_MACHO 0
  366. #endif
  367.  
  368.  
  369. #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
  370.  
  371. /*
  372.  * List of variable names for which NPP_GetValue shall be implemented
  373.  */
  374. typedef enum {
  375.   NPPVpluginNameString = 1,
  376.   NPPVpluginDescriptionString,
  377.   NPPVpluginWindowBool,
  378.   NPPVpluginTransparentBool,
  379.   NPPVjavaClass,                /* Not implemented in Mozilla 1.0 */
  380.   NPPVpluginWindowSize,
  381.   NPPVpluginTimerInterval,
  382.  
  383.   NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
  384.   NPPVpluginScriptableIID = 11,
  385.  
  386.   /* Introduced in Mozilla 0.9.9 */
  387.   NPPVjavascriptPushCallerBool = 12,
  388.  
  389.   /* Introduced in Mozilla 1.0 */
  390.   NPPVpluginKeepLibraryInMemory = 13,
  391.   NPPVpluginNeedsXEmbed         = 14,
  392.  
  393.   /* Get the NPObject for scripting the plugin. Introduced in Firefox
  394.    * 1.0 (NPAPI minor version 14).
  395.    */
  396.   NPPVpluginScriptableNPObject  = 15,
  397.  
  398.   /* Get the plugin value (as \0-terminated UTF-8 string data) for
  399.    * form submission if the plugin is part of a form. Use
  400.    * NPN_MemAlloc() to allocate memory for the string data. Introduced
  401.    * in Mozilla 1.8b2 (NPAPI minor version 15).
  402.    */
  403.   NPPVformValue = 16
  404. } NPPVariable;
  405.  
  406. /*
  407.  * List of variable names for which NPN_GetValue is implemented by Mozilla
  408.  */
  409. typedef enum {
  410.   NPNVxDisplay = 1,
  411.   NPNVxtAppContext,
  412.   NPNVnetscapeWindow,
  413.   NPNVjavascriptEnabledBool,
  414.   NPNVasdEnabledBool,
  415.   NPNVisOfflineBool,
  416.  
  417.   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
  418.   NPNVserviceManager = (10 | NP_ABI_MASK),
  419.   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
  420.   NPNVDOMWindow      = (12 | NP_ABI_MASK),
  421.   NPNVToolkit        = (13 | NP_ABI_MASK),
  422.   NPNVSupportsXEmbedBool = 14,
  423.  
  424.   /* Get the NPObject wrapper for the browser window. */
  425.   NPNVWindowNPObject = 15,
  426.  
  427.   /* Get the NPObject wrapper for the plugins DOM element. */
  428.   NPNVPluginElementNPObject = 16
  429. } NPNVariable;
  430.  
  431. /*
  432.  * The type of Tookkit the widgets use
  433.  */
  434. typedef enum {
  435.   NPNVGtk12 = 1,
  436.   NPNVGtk2
  437. } NPNToolkitType;
  438.  
  439. /*
  440.  * The type of a NPWindow - it specifies the type of the data structure
  441.  * returned in the window field.
  442.  */
  443. typedef enum {
  444.   NPWindowTypeWindow = 1,
  445.   NPWindowTypeDrawable
  446. } NPWindowType;
  447.  
  448. typedef struct _NPWindow
  449. {
  450.   void* window;  /* Platform specific window handle */
  451.                  /* OS/2: x - Position of bottom left corner  */
  452.                  /* OS/2: y - relative to visible netscape window */
  453.   int32 x;       /* Position of top left corner relative */
  454.   int32 y;       /* to a netscape page.                    */
  455.   uint32 width;  /* Maximum window size */
  456.   uint32 height;
  457.   NPRect clipRect; /* Clipping rectangle in port coordinates */
  458.                    /* Used by MAC only.              */
  459. #if defined(XP_UNIX) && !defined(XP_MACOSX)
  460.   void * ws_info; /* Platform-dependent additonal data */
  461. #endif /* XP_UNIX */
  462.   NPWindowType type; /* Is this a window or a drawable? */
  463. } NPWindow;
  464.  
  465.  
  466. typedef struct _NPFullPrint
  467. {
  468.   NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
  469.   NPBool printOne;         /* TRUE if plugin should print one copy to default printer */
  470.   void* platformPrint; /* Platform-specific printing info */
  471. } NPFullPrint;
  472.  
  473. typedef struct _NPEmbedPrint
  474. {
  475.   NPWindow window;
  476.   void* platformPrint; /* Platform-specific printing info */
  477. } NPEmbedPrint;
  478.  
  479. typedef struct _NPPrint
  480. {
  481.   uint16 mode;               /* NP_FULL or NP_EMBED */
  482.   union
  483.   {
  484.     NPFullPrint fullPrint;   /* if mode is NP_FULL */
  485.     NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
  486.   } print;
  487. } NPPrint;
  488.  
  489. #if defined(XP_MAC) || defined(XP_MACOSX)
  490. typedef EventRecord    NPEvent;
  491. #elif defined(XP_WIN)
  492. typedef struct _NPEvent
  493. {
  494.   uint16 event;
  495.   uint32 wParam;
  496.   uint32 lParam;
  497. } NPEvent;
  498. #elif defined(XP_OS2)
  499. typedef struct _NPEvent
  500. {
  501.   uint32 event;
  502.   uint32 wParam;
  503.   uint32 lParam;
  504. } NPEvent;
  505. #elif defined (XP_UNIX) && defined(MOZ_X11)
  506. typedef XEvent NPEvent;
  507. #else
  508. typedef void*            NPEvent;
  509. #endif /* XP_MAC */
  510.  
  511. #if defined(XP_MAC) || defined(XP_MACOSX)
  512. typedef RgnHandle NPRegion;
  513. #elif defined(XP_WIN)
  514. typedef HRGN NPRegion;
  515. #elif defined(XP_UNIX) && defined(MOZ_X11)
  516. typedef Region NPRegion;
  517. #else
  518. typedef void *NPRegion;
  519. #endif /* XP_MAC */
  520.  
  521. #if defined(XP_MAC) || defined(XP_MACOSX)
  522. /*
  523.  *  Mac-specific structures and definitions.
  524.  */
  525.  
  526. typedef struct NP_Port
  527. {
  528.   CGrafPtr port; /* Grafport */
  529.   int32 portx;   /* position inside the topmost window */
  530.   int32 porty;
  531. } NP_Port;
  532.  
  533. /*
  534.  *  Non-standard event types that can be passed to HandleEvent
  535.  */
  536.  
  537. enum NPEventType {
  538.   NPEventType_GetFocusEvent = (osEvt + 16),
  539.   NPEventType_LoseFocusEvent,
  540.   NPEventType_AdjustCursorEvent,
  541.   NPEventType_MenuCommandEvent,
  542.   NPEventType_ClippingChangedEvent,
  543.   NPEventType_ScrollingBeginsEvent = 1000,
  544.   NPEventType_ScrollingEndsEvent
  545. };
  546.  
  547. #ifdef OBSOLETE
  548. #define getFocusEvent     (osEvt + 16)
  549. #define loseFocusEvent    (osEvt + 17)
  550. #define adjustCursorEvent (osEvt + 18)
  551. #endif
  552. #endif /* XP_MAC */
  553.  
  554. /*
  555.  * Values for mode passed to NPP_New:
  556.  */
  557. #define NP_EMBED 1
  558. #define NP_FULL  2
  559.  
  560. /*
  561.  * Values for stream type passed to NPP_NewStream:
  562.  */
  563. #define NP_NORMAL     1
  564. #define NP_SEEK       2
  565. #define NP_ASFILE     3
  566. #define NP_ASFILEONLY 4
  567.  
  568. #define NP_MAXREADY    (((unsigned)(~0)<<1)>>1)
  569.  
  570. #ifdef XP_MAC
  571. #pragma options align=reset
  572. #endif
  573.  
  574.  
  575. /*----------------------------------------------------------------------*/
  576. /*             Error and Reason Code definitions            */
  577. /*----------------------------------------------------------------------*/
  578.  
  579. /*
  580.  * Values of type NPError:
  581.  */
  582. #define NPERR_BASE                         0
  583. #define NPERR_NO_ERROR                    (NPERR_BASE + 0)
  584. #define NPERR_GENERIC_ERROR               (NPERR_BASE + 1)
  585. #define NPERR_INVALID_INSTANCE_ERROR      (NPERR_BASE + 2)
  586. #define NPERR_INVALID_FUNCTABLE_ERROR     (NPERR_BASE + 3)
  587. #define NPERR_MODULE_LOAD_FAILED_ERROR    (NPERR_BASE + 4)
  588. #define NPERR_OUT_OF_MEMORY_ERROR         (NPERR_BASE + 5)
  589. #define NPERR_INVALID_PLUGIN_ERROR        (NPERR_BASE + 6)
  590. #define NPERR_INVALID_PLUGIN_DIR_ERROR    (NPERR_BASE + 7)
  591. #define NPERR_INCOMPATIBLE_VERSION_ERROR  (NPERR_BASE + 8)
  592. #define NPERR_INVALID_PARAM               (NPERR_BASE + 9)
  593. #define NPERR_INVALID_URL                 (NPERR_BASE + 10)
  594. #define NPERR_FILE_NOT_FOUND              (NPERR_BASE + 11)
  595. #define NPERR_NO_DATA                     (NPERR_BASE + 12)
  596. #define NPERR_STREAM_NOT_SEEKABLE         (NPERR_BASE + 13)
  597.  
  598. /*
  599.  * Values of type NPReason:
  600.  */
  601. #define NPRES_BASE          0
  602. #define NPRES_DONE         (NPRES_BASE + 0)
  603. #define NPRES_NETWORK_ERR  (NPRES_BASE + 1)
  604. #define NPRES_USER_BREAK   (NPRES_BASE + 2)
  605.  
  606. /*
  607.  * Don't use these obsolete error codes any more.
  608.  */
  609. #define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
  610. #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
  611. #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
  612.  
  613. /*
  614.  * Version feature information
  615.  */
  616. #define NPVERS_HAS_STREAMOUTPUT      8
  617. #define NPVERS_HAS_NOTIFICATION      9
  618. #define NPVERS_HAS_LIVECONNECT       9
  619. #define NPVERS_WIN16_HAS_LIVECONNECT 9
  620. #define NPVERS_68K_HAS_LIVECONNECT   11
  621. #define NPVERS_HAS_WINDOWLESS        11
  622. #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
  623.  
  624. /*----------------------------------------------------------------------*/
  625. /*                        Function Prototypes                           */
  626. /*----------------------------------------------------------------------*/
  627.  
  628. #if defined(_WINDOWS) && !defined(WIN32)
  629. #define NP_LOADDS  _loadds
  630. #else
  631. #if defined(__OS2__)
  632. #define NP_LOADDS _System
  633. #else
  634. #define NP_LOADDS
  635. #endif
  636. #endif
  637.  
  638. #ifdef __cplusplus
  639. extern "C" {
  640. #endif
  641.  
  642. /*
  643.  * NPP_* functions are provided by the plugin and called by the navigator.
  644.  */
  645.  
  646. #ifdef XP_UNIX
  647. char* NPP_GetMIMEDescription(void);
  648. #endif /* XP_UNIX */
  649.  
  650. NPError NP_LOADDS NPP_Initialize(void);
  651. void    NP_LOADDS NPP_Shutdown(void);
  652. NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
  653.                           uint16 mode, int16 argc, char* argn[],
  654.                           char* argv[], NPSavedData* saved);
  655. NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
  656. NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
  657. NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
  658.                                 NPStream* stream, NPBool seekable,
  659.                                 uint16* stype);
  660. NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
  661.                                     NPReason reason);
  662. int32   NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
  663. int32   NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
  664.                             int32 len, void* buffer);
  665. void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
  666.                                    const char* fname);
  667. void    NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
  668. int16   NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
  669. void    NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
  670.                                 NPReason reason, void* notifyData);
  671. #ifdef OJI
  672. jref    NP_LOADDS NPP_GetJavaClass(void);
  673. #endif
  674. NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
  675. NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
  676.  
  677. /*
  678.  * NPN_* functions are provided by the navigator and called by the plugin.
  679.  */
  680. void    NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
  681.                               int* netscape_major, int* netscape_minor);
  682. NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
  683.                                    const char* target, void* notifyData);
  684. NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
  685.                              const char* target);
  686. NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
  687.                                     const char* target, uint32 len,
  688.                                     const char* buf, NPBool file,
  689.                                     void* notifyData);
  690. NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
  691.                               const char* target, uint32 len,
  692.                               const char* buf, NPBool file);
  693. NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
  694. NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
  695.                                 const char* target, NPStream** stream);
  696. int32   NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
  697. NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
  698. void    NP_LOADDS NPN_Status(NPP instance, const char* message);
  699. const char* NP_LOADDS    NPN_UserAgent(NPP instance);
  700. void*   NP_LOADDS NPN_MemAlloc(uint32 size);
  701. void    NP_LOADDS NPN_MemFree(void* ptr);
  702. uint32  NP_LOADDS NPN_MemFlush(uint32 size);
  703. void    NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
  704. #ifdef OJI
  705. JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
  706. jref    NP_LOADDS NPN_GetJavaPeer(NPP instance);
  707. #endif
  708. NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
  709. NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
  710. void    NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
  711. void    NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
  712. void    NP_LOADDS NPN_ForceRedraw(NPP instance);
  713. void    NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
  714. void    NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
  715.  
  716. #ifdef __cplusplus
  717. }  /* end extern "C" */
  718. #endif
  719.  
  720. #endif /* RC_INVOKED */
  721. #ifdef __OS2__
  722. #pragma pack()
  723. #endif
  724.  
  725. #endif /* _NPAPI_H_ */
  726.